package com.kwlt.smc.entity;

import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.kwlt.smc.util.ConUtils;



/**
 * 黑名单
 * @author wangweiheng
 *
 */
@Entity
@Table(name="KEYWORD")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Keyword {
	/**
	 * 关键字Id
	 */
	private Long keywordId;
	/**
	 * 关键字来源 1 运营商 2 通道 3 客户 4 其他
	 */
	private String source;
	/**
	 * 级别 1 全局 2 局部
	 */
	private String level;
	/**
	 * 关键字内容
	 */
	private String message;
	/**
	 * 用户编号
	 */
	private String userCode;
	/**
	 * 通道编号
	 */
	private String channelCode;
	
	/**
	 * 运营商
	 */
	private String operators;
	/**
	 * 状态
	 */
	private String status;
	private Date createDate;
	
	private String createBy;
	
	/**
	 * 格式化时间
	 */
	private String createDateStr;
	
	public Keyword(){
		
	}
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getKeywordId() {
		return keywordId;
	}
	public void setKeywordId(Long keywordId) {
		this.keywordId = keywordId;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public String getOperators() {
		return operators;
	}
	public void setOperators(String operators) {
		this.operators = operators;
	}
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
		this.setCreateDateStr(ConUtils.formatDate(createDate,"yyyy-MM-dd"));
	}
	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}
	
	public String getUserCode() {
		return userCode;
	}
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	public String getChannelCode() {
		return channelCode;
	}
	public void setChannelCode(String channelCode) {
		this.channelCode = channelCode;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	@Transient	
	public String getCreateDateStr() {
		return createDateStr;
	}

	public void setCreateDateStr(String createDateStr) {
		this.createDateStr = createDateStr;
	}
	@Override
	public String toString() {
		return "Keyword [keywordId=" + keywordId + ", source=" + source
				+ ", level=" + level + ", message=" + message + ", userCode="
				+ userCode + ", channelCode=" + channelCode + ", operators="
				+ operators + ", status=" + status + ", createDate="
				+ createDate + ", createBy=" + createBy + ", createDateStr="
				+ createDateStr + "]";
	}
}
